home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 25
/
AACD 25.iso
/
AACD
/
Magazine
/
Online
/
QMail
/
source
/
fd_copy.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1997-04-15
|
225 b
|
14 lines
#include <fcntl.h>
#include "fd.h"
int fd_copy(to,from)
int to;
int from;
{
if (to == from) return 0;
if (fcntl(from,F_GETFL,0) == -1) return -1;
close(to);
if (fcntl(from,F_DUPFD,to) == -1) return -1;
return 0;
}